/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.sgs.persist;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author MaUrO FiLhO
 */
@Entity
@javax.persistence.SequenceGenerator(name="seqepi_id_seqepi_seq", sequenceName="seqepi_id_seqepi_seq")
@Table(name = "seqepi")
@NamedQueries({
    @NamedQuery(name = "Seqepi.findAll", query = "SELECT s FROM Seqepi s"),
    @NamedQuery(name = "Seqepi.findByIdSeqepi", query = "SELECT s FROM Seqepi s WHERE s.idSeqepi = :idSeqepi")})
public class Seqepi implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator="seqepi_id_seqepi_seq")
    @Basic(optional = false)
    @Column(name = "id_seqepi")
    private Integer idSeqepi;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "seqepi")
    private Epi epi;

    public Seqepi() {
    }

    public Seqepi(Integer idSeqepi) {
        this.idSeqepi = idSeqepi;
    }

    public Integer getIdSeqepi() {
        return idSeqepi;
    }

    public void setIdSeqepi(Integer idSeqepi) {
        this.idSeqepi = idSeqepi;
    }

    public Epi getEpi() {
        return epi;
    }

    public void setEpi(Epi epi) {
        this.epi = epi;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSeqepi != null ? idSeqepi.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Seqepi)) {
            return false;
        }
        Seqepi other = (Seqepi) object;
        if ((this.idSeqepi == null && other.idSeqepi != null) || (this.idSeqepi != null && !this.idSeqepi.equals(other.idSeqepi))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.sgs.persist.Seqepi[idSeqepi=" + idSeqepi + "]";
    }

}
